home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Memphis Amiga Group / MAG DOS 2.0 Utilities Disk 09 (1992-05)(Memphis Amiga Group).zip / MAG DOS 2.0 Utilities Disk 09 (1992-05)(Memphis Amiga Group).adf / JM / JM.doc < prev    next >
Text File  |  1992-02-20  |  56KB  |  1,651 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                                   JM Users's Guide
  17.  
  18.  
  19.                        A Task Management System for the Amiga
  20.  
  21.                                      Version 1.0
  22.  
  23.  
  24.                                   (Copyright) 1992
  25.  
  26.                                      Steve Koren
  27.  
  28.                                   February 7, 1992
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           Table of Contents
  74.  
  75.             Introduction to JM........................................3
  76.             Installing JM.............................................4
  77.             Copyright and Distribution Conditions.....................6
  78.             JM Passive Reporting Modes................................7
  79.                General System Status..................................7
  80.                Process Status.........................................8
  81.                Uptime.................................................10
  82.                Detailed Task Information..............................11
  83.             JM Active Management Modes................................12
  84.                Changing Running Task Priorities.......................12
  85.                Invoking Task Watch....................................12
  86.                Task Logging...........................................13
  87.                CPU Bound Task Management..............................14
  88.                   Starting Managed Jobs Which Require Interaction.....16
  89.                   Changing the Weight of Running Managed Tasks........17
  90.             JM Customization and Configuration........................18
  91.                The .jmrc Config File..................................18
  92.                Other Options..........................................19
  93.             Technical Information and Theory..........................20
  94.             Bugs, Caveats, Disclaimers................................21
  95.             Future Enhancements.......................................24
  96.             Credits and Acknowledgments...............................25
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.           JM Job Management             Page 2               Users's Guide
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           Introduction to JM
  140.  
  141.             JM is a job management  system  for  the  Amiga.   It  requires
  142.             AmigaDos 2.04 or later.  JM  is  designed  for  68030/40  based
  143.             machines, but versions are provided for 68000/20 systems.
  144.  
  145.             JM  (Job  Manager)  is  a  tool  which  extends  the   AmigaDos
  146.             multitasking environment.  It can act in a  passive,  reporting
  147.             mode:
  148.  
  149.                * JM can monitor CPU use, and report the total CPU time  and
  150.                  CPU% for each task in the  system.   This  is  actual  CPU
  151.                  time, accurate to 1/60 sec., not a  guess  based  on  task
  152.                  switching counts.
  153.  
  154.                * JM can monitor and report  the  invocation  time  of  each
  155.                  task.
  156.  
  157.                * JM can monitor and report the system  load  average,  time
  158.                  since boot, used CPU time, idle CPU time, the #  of  tasks
  159.                  started and finished, and idle CPU percentage.
  160.  
  161.             It can also play an active roll:
  162.  
  163.                * JM can allocate CPU cycles in any ratio  to  multiple  CPU
  164.                  bound processes, something  not  before  possible  on  the
  165.                  Amiga.  (If you don't know whether you need this  feature,
  166.                  then you probably don't).
  167.  
  168.                * JM can assign default priorities to tasks as they start.
  169.  
  170.                * JM can log task activity to a disk file for later use.
  171.  
  172.             Last but not least, JM has very little  impact  on  the  system
  173.             itself; no  low  priority  "CPU  muncher"  tasks  are  started,
  174.             unlike some CPU usage monitor programs.
  175.  
  176.             JM is NOT, nor is it intended to be, nor will it  ever  become,
  177.             a general purpose system monitor ala Xoper.
  178.  
  179.             JM has a number of somewhat complex features; you will need  to
  180.             read this  documentation  to  fully  understand  it.   This  is
  181.             especially true for the more complex task management features.
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.           JM Job Management             Page 3               Users's Guide
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           Installing JM
  206.  
  207.             Follow these steps to install JM:
  208.  
  209.                1. Copy the "JM-Handler" file to  the  "L:"  directory.   If
  210.                   you have a 68000 or a 68020, copy  "JM-Handler.68000"  to
  211.                   "L:JM-Handler" instead.  If you use the wrong version  on
  212.                   those machines, your computer will certainly crash.
  213.  
  214.                2. Copy the ".jmrc" file to the "S:" directory.
  215.  
  216.                3. Copy  the  following  executable files to  a  location in
  217.                   your AmigaDos search path.   They  should  all  have  the
  218.                   "pure" bit set also, and can be made resident.
  219.  
  220.                   JM
  221.                   uptime
  222.                   stat
  223.                   ps
  224.                   pri
  225.                   taskinfo
  226.  
  227.                   If you have a 68000 or 68020, copy the ".68000"  versions
  228.                   to those names instead.
  229.  
  230.                4. Insert  "JM  -init"  as   early   as   possible  in  your
  231.                   s:startup-sequence file (but after "setpatch").
  232.  
  233.                5. Reboot the machine (or execute "JM -init" manually if  do
  234.                   not wish to reboot).
  235.  
  236.  
  237.             JM  has  several  clients (JM, uptime, ps, etc), and  a  server
  238.             ("JM-Handler").  "JM -init" starts the server, and  "JM  -halt"
  239.             stops it.   There  is  usually no reason to stop it, but it can
  240.             be stopped if need be.  JM will  complain if it cannot find the
  241.             server,  or  if  the  server  version does not match the client
  242.             version.  If the server is already halted, and  "JM  -halt"  is
  243.             executed, JM will  wait  several  seconds  for  the  server  to
  244.             respond before giving up.
  245.  
  246.             JM should include these files.   If  it  does  not,  then  your
  247.             system is incomplete or corrupt:
  248.  
  249.             JM.doc                 - This documentation file
  250.             .jmrc                  - The JM init file, to reside in S:
  251.             JM                     - The JM command, 68030/40 version
  252.             JM-Handler             - The JM handler, 68030/40 version
  253.             stat                   - A system status command, 68030/40
  254.             uptime                 - Reports system uptime, 68030/40
  255.             ps                     - Process status, 68030/40
  256.             pri                    - Change task priorities, 68030/40
  257.             taskinfo               - Detailed task info, 68030/40
  258.             JM.68000               - 68000/20 version of JM
  259.  
  260.  
  261.           JM Job Management             Page 4               Users's Guide
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.             JM-Handler.68000       - 68000/20 version of JM-Handler
  272.             stat.68000             - 68000/20 version of stat
  273.             uptime.68000           - 68000/20 version of uptime
  274.             ps.68000               - 68000/20 version of ps
  275.             pri.68000              - 68000/20 version of pri
  276.             taskinfo.68000         - 68000/20 version of taskinfo
  277.  
  278.  
  279.             Once again, double check that you are  running  AmigaDos  2.04.
  280.             JM does not handle 1.3 gracefully.
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.           JM Job Management             Page 5               Users's Guide
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           Copyright and Distribution Conditions
  338.  
  339.             JM  is  copyrighted freeware.  It may  be  freely  distributed,
  340.             given the following conditions:
  341.  
  342.                * JM may not be sold for more than the price  of  a  current
  343.                  Fish disk.  Fred Fish is  explicitly granted permission to
  344.                  distributed JM.
  345.  
  346.                * Written  permission from the author must be obtained if JM
  347.                  is to be included in any commercial software package.
  348.  
  349.                * Written  permission must also be obtained to include JM on
  350.                  any disk based commercial magazine.
  351.  
  352.                * The  entire  JM  system must be  distributed whole; pieces
  353.                  may not be left out, nor may they  be  changed.   In  par-
  354.                  ticular, you may not claim authorship of JM.
  355.  
  356.                * JM may  be  upload to BBS systems and electronic networks,
  357.                  IF and ONLY IF  those  systems make no copyright or owner-
  358.                  ship claims  to  uploaded software.  This MAY prohibit up-
  359.                  loading  to  Genie,  Compuserve, or other networks; please
  360.                  check  before  doing  so.   The   copyright on JM is owned
  361.                  solely by the author.
  362.  
  363.                * Since  JM  is  provided free of charge, no claims are made
  364.                  about its  suitability for any particular purpose, nor the
  365.                  quality  or  robustness of the  software or documentation.
  366.                  The  author  will  probably make an effort to resolve bugs
  367.                  in the software; he simply reserves the right not to.
  368.  
  369.             The  basic  concept is that you should use it in good faith and
  370.             not make a profit from it nor claim it as  your  own.   I  have
  371.             had  people  both  claim  authorship of and make a profit  from
  372.             other  free  software which I have written.  This is very  dis-
  373.             heartening to see.  Please don't.
  374.  
  375.  
  376.           Motivation for JM
  377.  
  378.             Why did I write JM?  Some of its task  management functions are
  379.             not  currently available elsewhere on the Amiga.  (For example,
  380.             the  CPU  ratio management is, at least for now, something that
  381.             only JM does).  The  other  reporting functions were just added
  382.             to  provide  a  complete set of utilities in one package.  Some
  383.             other  programs  provide CPU % numbers, but they usually either
  384.             guess  at  this  number based on task switch counts, or start a
  385.             low  priority  background task which uses all  unallocated  CPU
  386.             cycles (a kludgy solution).
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.           JM Job Management             Page 6               Users's Guide
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           JM Passive Reporting Modes
  404.  
  405.             General System Status
  406.  
  407.                JM  can  monitor  and  report  information about the current
  408.                Amiga multitasking  environment.   To  obtain general system
  409.                information, use the "stat" command.
  410.  
  411.                The general system status report looks like this:
  412.  
  413.                  System Boot Time         : 26-Jan-92 20:14:24
  414.                  Uptime                   : (0 days) 02:26:25.840
  415.                  Total idle CPU time      : (0 days) 01:28:35.600
  416.                  Total used CPU time      : (0 days) 00:57:39.380
  417.                  CPU/FPU                  : 68040/68040
  418.                  Tasks started/finished   : 113/100
  419.                  Recent idle CPU %        : 91.73%
  420.                  JM task manager is       : on  (0 managed tasks)
  421.                  JM task logging is       : off (0 log failures)
  422.                  JM task startup watch is : on
  423.  
  424.                Each field will be explained in greater detail:
  425.  
  426.                  System Boot Time: This is the date and time the JM  server
  427.                  was started.   Since  "JM  -init"  is  run  early  in  the
  428.                  startup-sequence,  this  is  also  the  system  boot  time
  429.                  (within a few seconds).
  430.  
  431.                  Uptime: This  is  the  time  the  system has been up.  The
  432.                  format is:  (d days) hh:mm:ss.ttt, where "ttt"  are  thou-
  433.                  sandths of a second.
  434.  
  435.                  Total idle CPU time: This is a  count  of  the  total idle
  436.                  CPU  time  system the system was booted.  All cycles which
  437.                  don't go to any other process are reflected here.
  438.  
  439.                  Total used CPU time: This is  the  opposite of the above -
  440.                  a count of the CPU time used for running processes.
  441.  
  442.                  Tasks  started/finished: This is a count of the  number of
  443.                  tasks  which  have  been  started  since  "JM  -init"  was
  444.                  invoked.  The  second number is a count of the tasks which
  445.                  have exited.
  446.  
  447.                  Recent idle CPU %: This is a  sliding scale of the percent
  448.                  of CPU time not used.  In other words, if 0%  of  the  CPU
  449.                  has been used, and  suddenly 50% is used, this number will
  450.                  asymptotically  approach  50%,  getting there in  about  a
  451.                  minute, depending on various configuration options.
  452.  
  453.                  JM  task  manager is: This value is  either "on" or "off",
  454.                  an  indicates whether JM is permitted to share the CPU un-
  455.                  equally among CPU bound  tasks.   See  Job  Management for
  456.                  details.
  457.  
  458.  
  459.           JM Job Management             Page 7               Users's Guide
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.                  JM task logging is:    Again,  either "on" or  "off".   JM
  471.                  can log task activity to a disk file for later use.
  472.  
  473.                  JM  task  startup watch is: "on" or "off".  JM  can  watch
  474.                  tasks  starting up, and change  their  priority to a given
  475.                  default based on the task name.  If "off", this  will  not
  476.                  happen.
  477.  
  478.                  The  configurable  parameters can be changed through vari-
  479.                  ous options to the JM command.
  480.  
  481.  
  482.             Process Status
  483.  
  484.                JM  provides an  enhanced process status command, similar to
  485.                the  AmigaDos  "status".  Use the "ps" command to list tasks
  486.                and processes.
  487.  
  488.                The  default  "ps"  output  lists  every task in the system.
  489.                The following information is printed for each task:
  490.  
  491.                Num       - A task ID number.  Since AmigaDos  only  assigns
  492.                            ID  numbers to CLI processes, this is an equiva-
  493.                            lent for other tasks and  serves  as  a  way  to
  494.                            specify these  tasks.   This  number will be the
  495.                            same over the life of a task, given that the  JM
  496.                            server is not stopped.   This  ID  number can be
  497.                            used in the "pri" and "taskinfo" commands.
  498.  
  499.                Task Name - The task name, for tasks, and the  process name,
  500.                            for processes.  If  the  entry is a CLI process,
  501.                            the name will be  prefixed by [CLI n], where "n"
  502.                            is the  CLI  number.   Imbedded newlines are re-
  503.                            moved from process names.
  504.  
  505.                Pri       - The task priority: ranges from -128 to 127.
  506.  
  507.                RUN Time  - The "wall clock"  time  since  this  process was
  508.                            started.  The format is: hhhh:mm:ss.
  509.  
  510.                CPU Time  - A  measure of the amount of CPU time  this  pro-
  511.                            cess has taken since it was invoked.   The  for-
  512.                            mat  is  hhhh:mm:ss.ttt  (where  ttt  are  thou-
  513.                            sandths  of  a  second).  This count is accurate
  514.                            to  approximately 0.016 seconds on a NTSC Amiga,
  515.                            and  0.020  seconds on a PAL Amiga.  CPU  bursts
  516.                            less  than  0.016  seconds may not be noticed by
  517.                            JM.  The ones that are will be counted as  0.016
  518.                            seconds, so this tends  to  average out to about
  519.                            the right thing in the end.
  520.  
  521.  
  522.  
  523.  
  524.  
  525.           JM Job Management             Page 8               Users's Guide
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.                CPU %     - This is a weighted  percentage of the recent CPU
  536.                            use of this task.   100.0%  would  indicate that
  537.                            this task has take all the  recent CPU time, and
  538.                            0.0% means that it has take  none.   This  is  a
  539.                            floating  percentage: if a task was  taking 0.0%
  540.                            of the CPU, and starts to take 50%,  its  CPU  %
  541.                            will ramp up from 0% to 50%  over  approximately
  542.                            one minute of  real  time.   This  can  be  con-
  543.                            trolled though various parameters to JM.
  544.  
  545.                Stack     - The  stack  space  in  bytes  allocated to  this
  546.                            task.
  547.  
  548.                Use       - The  stack  space  actually in use by this task.
  549.                            Sometimes this will show up as "0" if JM is  un-
  550.                            able to figure it out.
  551.  
  552.                There are also several options  available  to  restrict  the
  553.                "ps" output to a certain set of tasks:
  554.  
  555.                -cli      - Lists only command  line  interface  tasks  (the
  556.                            ones which usually show up  using  the  AmigaDos
  557.                            "status" command).
  558.  
  559.                -m        - Lists only tasks managed  by  JM.   More  detail
  560.                            will be given on this later.
  561.  
  562.                -z        - Lists only  tasks  which  have  "0.0"  as  their
  563.                            current CPU use percentage.
  564.  
  565.                -n        - Lists only tasks which  do  not  have  "0.0"  as
  566.                            their current CPU use percentage.
  567.  
  568.                -bg       - Lists only "background" tasks, with  a  priority
  569.                            less than 0.  Same as -plt 0.
  570.  
  571.                -fg       - Lists only "foreground" tasks, with  a  priority
  572.                            greater than or equal to  0  and  less  than  or
  573.                            equal to 5.  Same as -pgt -1 -plt 6.
  574.  
  575.                -rt       - Lists only "real time" tasks,  with  a  priority
  576.                            greater than 5.  Same as -pgt 5.
  577.  
  578.                -pgt num  - Lists only tasks  with  a  priority greater than
  579.                            <num>.  Can be combined with -plt.
  580.  
  581.                -plt num  - Lists  only  tasks  with  a  priority less  than
  582.                            <num>.  Can be combined with -pgt.
  583.  
  584.                -peq num  - Lists  only  tasks  with  a  priority  equal  to
  585.                            <num>.
  586.  
  587.                -ple num  - Priorities less than or equal to num.
  588.  
  589.  
  590.  
  591.           JM Job Management             Page 9               Users's Guide
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                -pge num  - Priorities greater than or equal to num.
  602.  
  603.                Misc. options:
  604.  
  605.                -h        - Prints an extended PS header,  listing  the  CPU
  606.                            and FPU type, idle  CPU  time,  used  CPU  time,
  607.                            idle CPU %, and a few other things.
  608.  
  609.                -nocli    - Leave out CLI numbers in task names.
  610.  
  611.                And options to sort the task list various ways:
  612.  
  613.                -name     - Sort task list by name.
  614.  
  615.                -cpup     - Sort task list by CPU %.
  616.  
  617.                -cput     - Sort task list by CPU time.
  618.  
  619.                -pri      - Sort task list by priority.
  620.  
  621.                -inv      - Inverse (backwards) sort.
  622.  
  623.                Most  of  the  "pruning"  options  to  "ps"   are   mutually
  624.                exclusive, as are the sorting options.  Some options can  be
  625.                combined.   For  example,  to  list  only  CLI  tasks   with
  626.                priorities greater than 2, in order by CPU time:
  627.  
  628.                ps -cli -pgt 2 -cput
  629.  
  630.  
  631.             Uptime
  632.  
  633.                The "uptime" command is similar to the Unix version,  except
  634.                that it does not print the number of  users  logged  in,  as
  635.                this is meaningless on the Amiga.  "Uptime" will  report the
  636.                following information:
  637.  
  638.                  up 0 days, 02:58:51,  load average: 0.25, 0.23, 0.22
  639.  
  640.                The first time printed is  the  amount  of  time  since  the
  641.                Amiga was booted.  There are  also  three  numbers after the
  642.                "load  average".  They are  the  average system load for the
  643.                past  30  seconds,  the  past  2.5  minutes, and the past  5
  644.                minutes.  This  number is a measure of the average number of
  645.                tasks  waiting to run over  any  given  time.   A  count  of
  646.                "0.00" means the CPU is unloaded.  A count of  "1.00"  means
  647.                that,  on  average, the CPU  always had a job to run.  (This
  648.                would be the  case,  for  example, if a numbercrunching pro-
  649.                gram such as a ray tracer  was  running).  A count of "2.00"
  650.                means that,  on  average, there were always 2 tasks ready to
  651.                run.  This would be the case if a  ray  tracer  and  "lharc"
  652.                were  both  running at once - each would want  100%  of  the
  653.                CPU, hence, the  load  average would be 2.00.  (Actually, it
  654.                would be a little higher if you  were  typing or doing other
  655.  
  656.  
  657.           JM Job Management            Page 10               Users's Guide
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.                interactive things on the system at the same time).
  668.  
  669.  
  670.             Detailed Task Information
  671.  
  672.                The  "taskinfo"  command can be used to list detailed infor-
  673.                mation about a given task.  The  task  can  by  indicated by
  674.                name or ID  number (the ID number is the one reported by the
  675.                "ps" command):
  676.  
  677.                  taskinfo mg
  678.                  taskinfo 12
  679.  
  680.                Multiple task names or  numbers can be given, and "taskinfo"
  681.                will output information on each, separated by a newline.
  682.  
  683.                In  addition to the  fields  listed  by  the  "ps"  command,
  684.                "taskinfo" reports the following:
  685.  
  686.                Max Stack - A  rough  estimate  of  the  maximum stack space
  687.                            used by this task since it has  started.   Don't
  688.                            place too much faith in this, since it  is  pos-
  689.                            sible for  JM  to  miss  a  sudden and brief in-
  690.                            crease in stack space.
  691.  
  692.                Starttime - Date and time when the task was started.
  693.  
  694.                Launches  - The  number of times AmigaDos  has  switched  to
  695.                            this task since the task was started.
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.           JM Job Management            Page 11               Users's Guide
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.           JM Active Management Modes
  735.  
  736.             Changing Running Task Priorities
  737.  
  738.                JM can  change  the  priority of running tasks, given a task
  739.                name or ID number.  For example:
  740.  
  741.                  pri mg 2          # change priority of "mg" to 2
  742.                  pri 79 -3         # change priority of task 79 to -3
  743.  
  744.                More than one set of parameters can be given:
  745.  
  746.                  pri task1 3  task2 4
  747.  
  748.                An  error  is  reported if the given task name or ID  number
  749.                does not exist, or if the priority value is out of range.
  750.  
  751.  
  752.             Invoking Task Watch
  753.  
  754.                JM can watch tasks as they start up.  If it sees  one  which
  755.                it  recognizes,  it  can  immediately change the priority of
  756.                this task to  a  given  default value.  This is often useful
  757.                for  programs which provide no built in method to save a de-
  758.                fault  priority.   For  example, suppose you run the Imagine
  759.                ray  tracer,  and  after you start it,  you  always manually
  760.                change  the  priority of it to "-5" so that the rest of  the
  761.                system  performs  well  during rendering.  Also, suppose you
  762.                use the "less" pager, and  always want it to run with a pri-
  763.                ority of "2" for good  interactive performance during loaded
  764.                system conditions.  Both of these things are easy to  accom-
  765.                plish by using JM's watch feature.
  766.  
  767.                The  standard way to list task names and their  default pri-
  768.                orities  is  in  the  "s:.jmrc"  default file.  However, new
  769.                values may be added to a running JM server as follows:
  770.  
  771.                  JM -watch -add MyTask1 MyPri1  MyTask2 MyPri2 ...
  772.  
  773.                Any  number of task  name  and  priority pairs may be given.
  774.                Here is an example with real names:
  775.  
  776.                  JM -watch -add less 2
  777.  
  778.                Names added in this way will only  be  in  effect as long as
  779.                the  current JM server is active.  To make  them  permanent,
  780.                put them in the s:.jmrc file.
  781.  
  782.                The current watch list can be listed:
  783.  
  784.                  JM -watch -list
  785.  
  786.                This will produce a listing similar to the following:
  787.  
  788.  
  789.           JM Job Management            Page 12               Users's Guide
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.                  Task Startup Watch List:
  801.                    mg                       2
  802.                    MEmacs                   2
  803.                    calendar                 5
  804.                    calculator               1
  805.  
  806.                Note  that  these  are  not  running tasks.  They are simply
  807.                names which JM will watch for.  If it sees one start up,  it
  808.                will  give  it  the  indicated priority.  The names are  not
  809.                case sensitive, nor do they include pathnames.
  810.  
  811.                Names  can  be  removed from the watch list of a  running JM
  812.                server:
  813.  
  814.                  JM -watch -del MyTask1 MyTask2...
  815.  
  816.                Also, the watch mechanism can be turned off:
  817.  
  818.                  JM -watch -off
  819.  
  820.                and back on:
  821.  
  822.                  JM -watch -on
  823.  
  824.                When off, tasks are  started  with  the  priority they would
  825.                have had if JM was not running.  The default is "on".
  826.  
  827.                Version 1.0 of JM can store up to 64 watch entries.
  828.  
  829.  
  830.             Task Logging
  831.  
  832.                JM  can  keep  an  audit log of task activity for later use.
  833.                Each time a task  ends,  a  line  is  written to a disk file
  834.                containing the task  name,  the  priority, the start time of
  835.                the task, the end time of the task, and  total amount of CPU
  836.                time taken by this task over  its  lifetime.   If  for  some
  837.                reason  JM  is  unable to open or write to the log file,  it
  838.                will keep a count of  "logging errors" and print this infor-
  839.                mation in the "stat" command.
  840.  
  841.                The name of the log  file  defaults to "ram:JM.log", but can
  842.                be changed in the s:.jmrc defaults file.
  843.  
  844.                Logging can be turned on:
  845.  
  846.                  JM -log -on
  847.  
  848.                and back off again:
  849.  
  850.                  JM -log -off
  851.  
  852.  
  853.  
  854.  
  855.           JM Job Management            Page 13               Users's Guide
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.             CPU Bound Task Management
  866.  
  867.                With faster  68030  and  68040  Amigas  becoming more common
  868.                each  day,  and  with  the  advent of powerful CPU intensive
  869.                software such  as  Imagine, Scenery Animator, etc., more and
  870.                more  Amigas  are  finding their way  into  number crunching
  871.                applications.  They  cannot come close to the performance of
  872.                high  speed  workstations, but they also  are  affordable by
  873.                mere mortals, and have a large software base.
  874.  
  875.                The Amiga OS is  brutally efficient at multitasking.  A num-
  876.                ber of number-crunching tasks  may  be  running in the back-
  877.                ground, and if they  have  low  priority, there is almost no
  878.                noticeable   affect   on   foreground   interactive   tasks.
  879.                AmigaDos is one of  the  best  operating systems in this re-
  880.                gard,  outperforming even most  varieties of Unix, and being
  881.                far  better  than  Apple  System 7 and Windows 3.x software.
  882.                However, there are  limits to the Amigas flexibility in this
  883.                area.
  884.  
  885.                Specifically, if two number-crunching  tasks  are  vying for
  886.                continuous use of the CPU, one of two cases  must  be  true.
  887.                Either 1) they both have  the  same  priority, and share the
  888.                available CPU time in a  50/50  ratio, or 2) one has a lower
  889.                priority, and gets no CPU time at all, since it all goes  to
  890.                the higher priority task.
  891.  
  892.                Advanced Amiga  users who run several of these types of jobs
  893.                at once may wish  to  have  more  control over how their CPU
  894.                cycles are  allocated.   JM  was  invented primarily to fill
  895.                this  need;  the  other  reporting  aspects  are  merely  an
  896.                afterthought.
  897.  
  898.                JM  can  allocate the CPU to  low  priority number-crunching
  899.                tasks in any user  defined ratio.  Let us assume that we are
  900.                dealing with 3 tasks.  One is  Scenery Animator (the terrain
  901.                rendering  program from Natural Graphics), one is MandelPAUG
  902.                (a  freeware  Mandelbrot  animation  program),  and  one  is
  903.                "longpi" (a small freeware  program which computes pi to any
  904.                number of  places).   Normally, these tasks all want as much
  905.                of the CPU as they can get.  If  they  are  all  to  run  at
  906.                once, there would be no choice but to give  equal  CPU  time
  907.                to each.
  908.  
  909.                JM keeps a list of tasks which we wish to  "manage" by allo-
  910.                cating  CPU  resources  unequally  between them.   When  one
  911.                starts up, it is put on  the  management list, and is there-
  912.                after allocated only its fair share of the CPU.
  913.  
  914.                Lets take  an  example, for clarity.  The "JM -manage -list"
  915.                command will list the tasks  which  JM  will  manage, if and
  916.                when they start up.  It will also list the  tasks  currently
  917.                being managed.  Here is a sample output:
  918.  
  919.  
  920.  
  921.           JM Job Management            Page 14               Users's Guide
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.                  Manage Watch List:
  932.                    SceneryAnimator         12
  933.                    MandelPAUG               8
  934.                    longpi                   1
  935.  
  936.                  Managed Task List:
  937.                    <none>
  938.  
  939.                In  this  example, JM will watch for tasks with those  three
  940.                names to start up.  The task name is, again, not  case  sen-
  941.                sitive, nor  does  it  include path names.  The number after
  942.                the task name is the  number of CPU time quantum to allocate
  943.                to this  task.   (The  length  of  one  time  quantum can be
  944.                changed;  see  the  section  on  configuration of JM for de-
  945.                tails).
  946.  
  947.                If  MandelPAUG and longpi were run at once, out  of  each  9
  948.                time  quantum, 8 would go to MandelPAUG and 1 to longpi.  If
  949.                SceneryAnimator was then started, out of each 21 cycles,  it
  950.                would get  12,  MandelPAUG would get 8, and longpi would get
  951.                one.  In other words, the  exact ratio depends on the set of
  952.                running  managed jobs.  The more there are, the smaller  the
  953.                ratio of CPU time the other jobs get.
  954.  
  955.                Now let  us  assume that we have actually start up all three
  956.                of those tasks.   (Remember, the top list is simply the list
  957.                of things JM will watch for).  "JM  -manage -list" now looks
  958.                like this:
  959.  
  960.                  Manage Watch List:
  961.                    SceneryAnimator         12
  962.                    MandelPAUG               8
  963.                    longpi                   1
  964.  
  965.                  Managed Task List:
  966.                    [CLI 7] longpi           1/21   (4%)
  967.                    [CLI 9] MandelPAUG       8/21   (38%)
  968.                    SceneryAnimator         12/21   (57%)
  969.  
  970.                (Scenery  Animator does not have a [CLI n] in front  because
  971.                I  started  it  from  workbench).    Under the "Managed Task
  972.                List", we see that  all  three  programs are running.  There
  973.                are 21  available quantum per cycle, and longpi is getting 1
  974.                (or 4% of the  CPU),  MandelPAUG is getting 8 (or 38% of the
  975.                CPU),  and  SceneryAnimator  is  getting 12 (or 57%  of  the
  976.                CPU).    Actually, these CPU percentages are simply computed
  977.                based on the  number of quantum and the manage list numbers.
  978.                They are theoretical.  To list  the  _actual_ CPU use of all
  979.                managed jobs, we can use the "ps" command.  Of course,  "ps"
  980.                normally lists 20  to  40  running tasks, and we want to see
  981.                only  the  managed ones, so use "ps -m".  Here is a  partial
  982.                "ps"  listing from  my  system right now.  (Partial, since I
  983.                can't fit all 78  columns  within  the  margin of this docu-
  984.                ment):
  985.  
  986.  
  987.           JM Job Management            Page 15               Users's Guide
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.                Num  Task_Name          RUN Time       CPU Time   CPU%
  999.                  1  [CLI 9] MandelPAUG  0:19:10    0:07:05.566  35.2%
  1000.                  2  SceneryAnimator     0:16:09    0:06:14.783  53.1%
  1001.                  3  [CLI 7] longpi      0:19:29    0:02:57.433   3.7%
  1002.  
  1003.                (I  deleted  3  of  "ps"s  output columns).  Here we can see
  1004.                that  the  actual  CPU  ratios are not quite  as  predicted.
  1005.                Why?  Well, there are two reasons.  First of all,  they  are
  1006.                ALL less  than  predicted because 100% of all the CPU cycles
  1007.                are  NOT  available to these three tasks, since I am  typing
  1008.                this  document  into  a  word  processor right  now  in  the
  1009.                foreground.  (Together  they  are  getting a bit over 92% of
  1010.                the CPU).  Also, we see an anomaly in  that  SceneryAnimator
  1011.                is  getting less  than  the  ratio we thought it would, even
  1012.                taking the above into account.  This  is  because it is gen-
  1013.                erating  an  animation to hard disk, and while it is writing
  1014.                each frame, it  is  not  using the CPU, nor does it want to.
  1015.                It  is  giving up  a  few  percent of the cycles it could be
  1016.                getting.   The  predicted CPU percentages will only be close
  1017.                if all tasks want the CPU at all times.  If they give it  up
  1018.                voluntarily   sometimes,  they  will  use  less  than  their
  1019.                allotment.  We can also see that  "MandelPAUG" has used 4:27
  1020.                of  CPU  time  compared to SceneryAnimator's 2:01.  This  is
  1021.                because I started  it  three  minutes ahead of SceneryAnima-
  1022.                tor, so it has had more time to accumulate CPU time.
  1023.  
  1024.                The  allocation  strategy is as follows.  If  the  "primary"
  1025.                running  managed task wants the CPU, it gets  it.   If  not,
  1026.                the cycles it does not  want  are  split  evenly  among  all
  1027.                other  managed jobs.  This turns out to be a  good  strategy
  1028.                in most cases.
  1029.  
  1030.                Starting Managed Jobs Which Require Interaction
  1031.  
  1032.                Lets say  that  3  managed jobs are running now, and we wish
  1033.                to add a fourth, but the  fourth  requires a bit of user in-
  1034.                teraction  before  it  begins numbercrunching.  (Two of  the
  1035.                three  programs above  are  in  this  category).  If we just
  1036.                start  it  normally, it will only get x% of the CPU, where x
  1037.                may be fairly small.  This will make it very  hard  to  deal
  1038.                with interactively.  What do we do  about  this?   Well,  we
  1039.                can  instruct JM to turn off  management for a while.  We do
  1040.                this via:
  1041.  
  1042.                  JM -manage -off
  1043.  
  1044.                When JM turns off task  management, all the managed tasks DO
  1045.                continue to run.  They just do so all at the same  priority,
  1046.                which is very low.  We can then  start  our  fourth  job  in
  1047.                peace,  and  interact with it as  a  foreground application.
  1048.                As soon as it is set up and number-crunching  away,  we  can
  1049.                turn task management back on via:
  1050.  
  1051.  
  1052.  
  1053.           JM Job Management            Page 16               Users's Guide
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                  JM -manage -on
  1064.  
  1065.                Now, this task is put into the  managed queue with the other
  1066.                managed tasks and gets its expected ratio of CPU cycles.
  1067.  
  1068.                Tasks may be added  to  or  deleted from the JM task manage-
  1069.                ment watch list in the  same  manner as listed for the "JM -
  1070.                watch" option.  Namely:
  1071.  
  1072.                  JM -manage -add task1 quantum1  task2 quantum2 ...
  1073.                  JM -manage -del task1 task2 ...
  1074.  
  1075.                Note that these only  affect the list of watched task names,
  1076.                NOT the  actual running tasks.  If a task is "added", but it
  1077.                alreay exists, its weight is modified accordingly.
  1078.  
  1079.  
  1080.                Changing the Weight of Running Managed Tasks
  1081.  
  1082.                The  CPU  weight  of  a  running managed task may be changed
  1083.                via:
  1084.  
  1085.                  JM -manage -mod taskname newquant
  1086.  
  1087.                If  a  currently  running  managed task named "taskname"  is
  1088.                running,  its  quantum value is changed to  "newquant".  For
  1089.                example, if the old "jm -manage -list" output was:
  1090.  
  1091.                  Manage Watch List:
  1092.                    SceneryAnimator         12
  1093.                    MandelPAUG               8
  1094.                    longpi                   1
  1095.  
  1096.                  Managed Task List:
  1097.                    [CLI 7] longpi           1/9   (11%)
  1098.                    [CLI 9] MandelPAUG       8/9   (88%)
  1099.  
  1100.                And we executed:
  1101.  
  1102.                  JM -manage -mod longpi 4
  1103.  
  1104.                The new result would be:
  1105.  
  1106.                  Manage Watch List:
  1107.                    SceneryAnimator         12
  1108.                    MandelPAUG               8
  1109.                    longpi                   1
  1110.  
  1111.                  Managed Task List:
  1112.                    [CLI 7] longpi           4/12   (33%)
  1113.                    [CLI 9] MandelPAUG       8/12   (66%)
  1114.  
  1115.                Note  that  this  does  not  affect the watch list, only the
  1116.                list of managed tasks actually running.
  1117.  
  1118.  
  1119.           JM Job Management            Page 17               Users's Guide
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.             JM Customization and Configuration
  1130.  
  1131.                The .jmrc Config File
  1132.  
  1133.                How do  you  customize and configure JM to suite your needs?
  1134.                You copy the .jmrc file to  your  s:  directory, and edit it
  1135.                to suite your tastes.  This file has  comments which attempt
  1136.                to  explain its format and content.  This comments should be
  1137.                left in  place  for  future use; they are read fast, so they
  1138.                incur very little startup penalty.
  1139.  
  1140.                Here  is  a  brief  description of the types of things which
  1141.                can be put in this file.
  1142.  
  1143.                LOGSWITCH       off
  1144.  
  1145.                This  can  be  either "off" or "on".  If "on", JM  will  log
  1146.                task activity to a disk file by default.
  1147.  
  1148.                LOGFILE         "ram:JM.log"
  1149.  
  1150.                This is the name of the file  to  log  task  activity to, if
  1151.                logging is turned on.
  1152.  
  1153.                PS_CPU_TIME      5
  1154.  
  1155.                The  CPU  percentage fields in the "ps"  output are only up-
  1156.                dated once in this many seconds.  5 is a  good  value.   The
  1157.                larger the value, the  longer  the  convergence time of this
  1158.                percentage.    (Remember, it is  a  sliding average, and re-
  1159.                flects  recent  historical CPU use as  well  as  current CPU
  1160.                use).
  1161.  
  1162.                MANAGESWITCH     on
  1163.  
  1164.                Can be "on" or "off".  If "on", JM will watch for  tasks  to
  1165.                manage.  If "off", it won't.
  1166.  
  1167.                WATCHSWITCH      on
  1168.  
  1169.                Can be "on" or "off".  If "on", JM will  assign default pri-
  1170.                orities to newly started tasks.
  1171.  
  1172.                QUANTUM          5
  1173.  
  1174.                The length of  one  management quantum in 1/10s of a second.
  1175.                For  example, if a managed task has a value of "10", it will
  1176.                get  10  quantum in a row before giving up the CPU.  In this
  1177.                case,  each  quantum would be 1/2 second (5/10), so the task
  1178.                would get the CPU  for  5  seconds in a row.  If the quantum
  1179.                time is  reduced, smoother results are obtained.  There is a
  1180.                very  slight  overhead  penalty for this, but it  should  be
  1181.                nearly,  if  not  actually, immeasurable on a 68030 or 68040
  1182.                system.  68030/40s have no trouble with a QUANTUM of 1.
  1183.  
  1184.  
  1185.           JM Job Management            Page 18               Users's Guide
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.                MIN_MANAGE_PRI   -26
  1197.                MAX_MANAGE_PRI   -25
  1198.  
  1199.                This  two  lines  control the minimum and maximum priorities
  1200.                used by  the  managed tasks.  The "current" managed task has
  1201.                the  maximum priority, and all others have the minimum.  Ob-
  1202.                viously, the max must be larger than the min.   Each  should
  1203.                be small, so  that  these  managed number-crunching tasks do
  1204.                not affect the interactive performance of the system.
  1205.  
  1206.                TASKPRI          "MEmacs"          2
  1207.  
  1208.                Up to 64 of these lines may be  present.   They  control the
  1209.                default  task  priority for newly started tasks, if the task
  1210.                watch feature is turned on.
  1211.  
  1212.                MANAGE           "SceneryAnimator"     12
  1213.  
  1214.                Up to 16 of these lines may be  present.   They  control the
  1215.                number  of  contiguous management quantum which can be allo-
  1216.                cated to this task, if managed.
  1217.  
  1218.                Other Options
  1219.  
  1220.                JM can be made to re-read  the  .jmrc  file  without exiting
  1221.                and restarting the server.  Simply use:
  1222.  
  1223.                  JM -rc
  1224.  
  1225.                JM  currently prints no errors or warnings if the .jmrc file
  1226.                contents is found  to  be  invalid.   It  is  simply ignored
  1227.                quietly.
  1228.  
  1229.                Also, the time  quantum can be changed without having to re-
  1230.                read the .jmrc file via:
  1231.  
  1232.                  JM -quantum <num>
  1233.  
  1234.                Where num is the  new  quantum length, in units of 1/10 sec.
  1235.                If the argument is omitted, the old value is printed.
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.           JM Job Management            Page 19               Users's Guide
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.           Technical Information and Theory
  1262.  
  1263.             This  section is  included for people who are interested in how
  1264.             JM works internally.
  1265.  
  1266.             A running task has three basic types of time:
  1267.  
  1268.                1. Idle time: (i.e.,  it  is  not  using the CPU and doesn't
  1269.                   want to).  This would be the case if a  task  is  waiting
  1270.                   for some user input.
  1271.  
  1272.                2. CPU bursts:  This is the time a  process is using the CPU
  1273.                   as much as it can.   A  mostly  interactive program, such
  1274.                   as a  text  editor, will tend to have short CPU bursts in
  1275.                   the range of a few 10ths of a second.  A ray tracer  will
  1276.                   have long CPU bursts.
  1277.  
  1278.                3. I/O bursts: This is the time a  process spends doing I/O.
  1279.                   This may or may not also be  CPU  intensive, depending on
  1280.                   the disk controller.  Amiga 3000s, for  example, are very
  1281.                   good about using only a little CPU time during HD I/O.
  1282.  
  1283.             To  measure process CPU time, JM patches into the tc_Switch and
  1284.             tc_Launch  members of  the  exec  Task  structure.   These  are
  1285.             pointers  to  functions which are called when tasks  loose  and
  1286.             obtain the CPU.  JM points these  to  its  own  functions which
  1287.             remember  the  beginning and  ending times of each CPU burst of
  1288.             each task.  JM keeps this  information around in a structure it
  1289.             maintains explicitly for this purpose.
  1290.  
  1291.             This  structure also contains the task start time.  JM uses the
  1292.             AmigaDos  SetFunction() call to put its own code ahead  of  the
  1293.             system AddTask() and RemTask() functions.   This  way,  it  can
  1294.             store  datestamps  and  other  information during an AddTask(),
  1295.             and  free  the  information later  during a RemTask().  It also
  1296.             uses  this  mechanism to watch for tasks to which it  assigns a
  1297.             default priority.
  1298.  
  1299.             Upon  invocation with "JM -init", a "JM-Handler" is loaded from
  1300.             the L:  directory.   This  handler contains code which must al-
  1301.             ways be present  in  memory,  such  as  the  new  AddTask() and
  1302.             RemTask() code, and the code which is  patched  into  tc_Switch
  1303.             and tc_Launch.  There is also  a  process in here which listens
  1304.             for  messages  from  elsewhere, and  controls the "task manage-
  1305.             ment" parts of  JM  (which  allocate CPU resources to tasks un-
  1306.             equally).
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.           JM Job Management            Page 20               Users's Guide
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.             Bugs, Caveats, Disclaimers
  1328.  
  1329.             There are a  few  types  of  commonly encountered problems with
  1330.             JM.  Here are some:
  1331.  
  1332.                *  JM  decides how  to  manage tasks and allocate priorities
  1333.                   based  on  the  task  or  process name.  It is reasonably
  1334.                   smart  about  obtaining these names.  It  will  generally
  1335.                   see  them  correctly  if  started  from  either workbench
  1336.                   through  a  custom icon, or from a CLI window.   However,
  1337.                   there are at least two known cases where  the  task  name
  1338.                   is not present yet at the time JM sees  things.   One  is
  1339.                   the  "ToolsManager" utility which adds any program to the
  1340.                   tools menu of WB 2.04.  The other  is  from  a  "generic"
  1341.                   tool icon.  If the  program has its own icon, as most ex-
  1342.                   ecutables do, it will work OK.  There is not much  I  can
  1343.                   do about  this  problem other than scan task names at an-
  1344.                   other  time  besides  task  startup as well as at startup
  1345.                   time.
  1346.  
  1347.                *  If CPU cycles are  not  allocated to managed tasks in the
  1348.                   ratios  you  expect, it could be because one of the tasks
  1349.                   is  giving up the  CPU  voluntarily (to wait for a system
  1350.                   resource,  for  example,  or  perform disk I/IO).  In any
  1351.                   case, there is a small amount of "slop" in  JM's  alloca-
  1352.                   tion  strategy.   The  percentages are approximate, accu-
  1353.                   rate to about  1%  under optimal conditions.  Also remem-
  1354.                   ber  that  the  CPU  percentages in the  "ps"  output are
  1355.                   sliding  averages, so  the  currently running managed job
  1356.                   will tend to have a  slightly  higher  percentage show up
  1357.                   while it is running.
  1358.  
  1359.                *  JM tries  to  operate in a system friendly fashion.  How-
  1360.                   ever,  it  is  examining a few deep, dark  corners of the
  1361.                   Amiga  operating  system which are not meant to be  exam-
  1362.                   ined by mere  mortals.   I  make  no  guarantees  that JM
  1363.                   will  do  anything at  all  in  future AmigaDos releases.
  1364.                   There is a great chance it will still work; I'm just  not
  1365.                   guaranteeing it.  If it does  break,  I  will  attempt to
  1366.                   fix it and release a new version.
  1367.  
  1368.                *  JM  uses  various fields in the AmigaDos  task  structure
  1369.                   which  are  allocated to user use.  If another program is
  1370.                   already  using these fields, JM will  not  use  them  and
  1371.                   will print "0"s for the CPU %, CPU time,  and  invocation
  1372.                   time fields in  the  "ps"  command.   I  cannot guarantee
  1373.                   that  some  _other_  program which  wants  these  fields,
  1374.                   started  after JM, will be as polite.  If you have one of
  1375.                   these, and it crashes with  JM  running, that is probably
  1376.                   why.    However, only  one  other  program that I know of
  1377.                   uses the fields which JM does, so this  is  not  expected
  1378.                   to be a big problem.  (The other one is part  of  one  of
  1379.                   the  14  MHz  68000  hardware  hacks,  so  users of those
  1380.                   boards may have troubles with JM).
  1381.  
  1382.  
  1383.           JM Job Management            Page 21               Users's Guide
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.                *  Users of  custom shells should be careful that any built-
  1395.                   in  "ps"  command does not override the definition of the
  1396.                   JM  "ps"  command.    Users of SKsh and CShell will  have
  1397.                   this  happen.    SKsh  users can remove the built-in SKsh
  1398.                   "ps"  function through  "unset  -b  ps".   Alternatively,
  1399.                   they can alias "ps" to the JM "ps" binary.  CShell  users
  1400.                   can also take this route.
  1401.  
  1402.                *  If JM crashes  upon  invocation, check that you are using
  1403.                   the  correct version for your machine.  I supply one ver-
  1404.                   sion  for  68000s  and  68020s,  and  a  separate one for
  1405.                   68030s and 68040s.  The 68030/40  users can use both, but
  1406.                   the  second is  optimized  for faster CPUs.  68000/20 us-
  1407.                   ers will  likely  crash  their  machines by attempting to
  1408.                   run the other version.   Also,  make  sure  you  are  use
  1409.                   AmigaDos 2.04.
  1410.  
  1411.                *  If you exit JM,  and  it  crashes  when  restarted, it is
  1412.                   likely  because  you  are  are  running "JM -init" before
  1413.                   "setpatch" instead of after.
  1414.  
  1415.                *  If  JM  exits  immediately with no output when you try to
  1416.                   start the server with "JM -init", then you might be  run-
  1417.                   ning  under AmigaDos 1.3.  JM will  not  work  under 1.3,
  1418.                   nor  do  I  have  any  desire to make it do so.  AmigaDos
  1419.                   2.04 is well worth the $99 for the upgrade.
  1420.  
  1421.                *  If  JM  complains  about  not  being able  to  invoke the
  1422.                   server,  make  sure  that  JM-Handler  is   in   the   L:
  1423.                   directory.
  1424.  
  1425.                *  If JM does not seem to  "see"  your  entries in the .jmrc
  1426.                   configuration file, make sure  this  file  resides in S:,
  1427.                   and that it is in  the  correct format, and that you have
  1428.                   invoked "JM -rc" to re-read the file after any changes.
  1429.  
  1430.                *  If a single tasks  accumulates more than about 1.13 years
  1431.                   of CPU time, it will "wrap"  around  to  0.   This  won't
  1432.                   hurt anything - it is just a display anomaly.
  1433.  
  1434.                *  Some  screen  blankers and other such things run  with  a
  1435.                   priority greater than that used by  JM  for  its  managed
  1436.                   tasks.  Thus, they will leave  no  free  cycles  for  the
  1437.                   background tasks.  If this is so,  simply adjust the pri-
  1438.                   orities in the s:.jmrc file, or  use  a  different screen
  1439.                   blanker.
  1440.  
  1441.                *  Sometimes CPU time is not charged to the task  you  think
  1442.                   it will be.  Here are two examples.   A  shell  may  take
  1443.                   less CPU time than  you  think,  because some of its time
  1444.                   is charged to the  CON  handler for scrolling text in the
  1445.                   window.  A screen blanker  which  continuously draws onto
  1446.                   its  custom screen might  actually be starting up a sepa-
  1447.  
  1448.  
  1449.           JM Job Management            Page 22               Users's Guide
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.                   rate task to  do  the  drawing, and killing it once it is
  1460.                   done, so the main  screen  blanker  task  will  use  very
  1461.                   little CPU time.
  1462.  
  1463.                *  Due  to  the  manner in which AmigaDos  executes programs
  1464.                   from  the  command  line  interface, JM will  not  notice
  1465.                   tasks  unless they are put into  the  background with the
  1466.                   AmigaDos RUN  command or a similar utility.  By executing
  1467.                   a  program  in  the  foreground, (such as  typing "dir"),
  1468.                   there is no new task created.  Whether this is  desirable
  1469.                   or not can be  debated, but it does mean that JM will not
  1470.                   see these tasks or be able to manage them.
  1471.  
  1472.                *  Since the CPU % printed  after each task in the "ps" com-
  1473.                   mand  output is a  weighted  average based on recent his-
  1474.                   torical CPU use by that task,  the  percentage values may
  1475.                   not  add  up  to  exactly what you  expect them to at any
  1476.                   given time.
  1477.  
  1478.                *  There  is  currently  no  graceful way to handle multiple
  1479.                   tasks with the same name,  other  than  always specifying
  1480.                   them by ID number.
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.           JM Job Management            Page 23               Users's Guide
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.           Future Enhancements
  1526.  
  1527.             By all means, feel  free  to  send  suggestions for JM to me at
  1528.             the address listed below.
  1529.  
  1530.             I would like to add at least the following to JM:
  1531.  
  1532.                *  A graphical, resizable, xload like CPU load meter.
  1533.  
  1534.                *  The use of  2.04  file  change  notification to eliminate
  1535.                   the need for the  "JM  -rc"  option to re-read the config
  1536.                   file.
  1537.  
  1538.                *  An  ARexx  interface to the JM server.  It might be  able
  1539.                   to query  the  status of JM (system uptime, load average,
  1540.                   etc.), and also set  various JM options, submit new items
  1541.                   to the JM lists, etc.  Would this be  useful?  If so, let
  1542.                   me know.
  1543.  
  1544.             You can contact me via US mail:
  1545.  
  1546.                     Steve Koren
  1547.                     405 Pulsar St.
  1548.                     Ft. Collins, CO 80525 USA
  1549.  
  1550.             or phone:
  1551.  
  1552.                     303-226-4985
  1553.  
  1554.             or email:
  1555.  
  1556.                     koren@hpfcly.fc.hp.com
  1557.                     koren@hpmoria.fc.hp.com
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.           JM Job Management            Page 24               Users's Guide
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.           Credits and Acknowledgments
  1592.  
  1593.             JM was written using SAS C 5.10b.
  1594.  
  1595.             JM was written on an Amiga 2000 with a PP&S 68040 card.
  1596.  
  1597.             Information  on  register  usage  of  routines was found in the
  1598.             "Amiga Programmer's Handbook", published by Sybex.
  1599.  
  1600.             Message  passing  examples  from  "Programmer's  Guide  to  the
  1601.             Amiga", by Rob Peck were very useful.
  1602.  
  1603.             The  output  format of  the  "uptime" command output was styled
  1604.             after the Unix command of the same name.
  1605.  
  1606.             JM  was  written using AmigaDos 2.04.  2.04 is a great improve-
  1607.             ment over 1.3.
  1608.  
  1609.             Thanks to Ray Zarling for  testing JM and providing useful sug-
  1610.             gestions and feedback.
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.           JM Job Management            Page 25               Users's Guide
  1648.  
  1649.  
  1650.  
  1651.